In number theory, an arithmetic (or arithmetical) function is a real or complex valued function ƒ(n) defined on the set of natural numbers (i.e. positive integers) that "expresses some arithmetical property of n."[1]
An example of an arithmetic function is the non-principal character (mod 4) defined by
To emphasise that they are being thought of as functions rather than sequences, values of an arithmetic function are usually denoted by a(n) rather than an.
There is a larger class of number-theoretic functions that do not fit the above definition, e.g. the prime-counting functions. This article provides links to functions of both classes.
and mean that the sum or product is over all prime numbers:
Similarly, and mean that the sum or product is over all prime powers with strictly positive exponent (so 1 is not counted):
and mean that the sum or product is over all positive divisors of n, including 1 and n. E.g., if n = 12,
The notations can be combined: and mean that the sum or product is over all prime divisors of n. E.g., if n = 18,
and similarly and mean that the sum or product is over all prime powers dividing n. E.g., if n = 24,
An arithmetic function a is
Two whole numbers m and n are called coprime if their greatest common divisor is 1; i.e., if there is no prime number that divides both of them.
Then an arithmetic function a is
The fundamental theorem of arithmetic states that any positive integer n can be factorised uniquely as a product of powers of primes: where p1 < p2 < ... < pk are primes and the aj are positive integers. (1 is given by the empty product.)
It is often convenient to write this as an infinite product over all the primes, where all but a finite number have a zero exponent. Define νp(n) as the exponent of the highest power of the prime p that divides n. I.e. if p is one of the pi then νp(n) = ai, otherwise it is zero. Then
In terms of the above the functions ω and Ω are defined by
To avoid repetition, whenever possible formulas for the functions listed in this article are given in terms of n and the corresponding pi, ai, ω, and Ω.
σk(n) is the sum of the kth powers of the positive divisors of n, including 1 and n, where k is a complex number.
σ1(n), the sum of the (positive) divisors of n, is usually denoted by σ(n).
Since a positive number to the zero power is one, σ0(n) is therefore the number of (positive) divisors of n; it is usually denoted by d(n) or τ(n) (for the German Teiler = divisors).
Setting k = 0 in the second product gives
φ(n), the Euler totient function, is the number of positive integers not greater than n that are coprime to n.
μ(n), the Möbius function, is important because of the Möbius inversion formula. See Dirichlet convolution, below.
This implies that μ(1) = 1. (Because Ω(1) = ω(1) = 0.)
τ(n), the Ramanujan tau function, is defined by its generating function identity:
Although it is hard to say exactly what "arithmetical property of n" it "expresses",[2] (τ(n) is (2π)−12 times the nth Fourier coefficient in the q-expansion of the modular discriminant function)[3] it is included among the arithmetical functions because it is multiplicative and it occurs in identities involving certain σk(n) and rk(n) functions (because these are also coefficients in the expansion of modular forms).
cq(n), Ramanujan's sum, is the sum of the nth powers of the primitive qth roots of unity:
Even though it is defined as a sum of complex numbers (irrational for most values of q), it is an integer. For a fixed value of n it is multiplicative in q:
Many of the functions mentioned in this article have expansions as series involving these sums; see the article Ramanujan's sum for examples.
λ(n), the Liouville function, is defined by
All Dirichlet characters χ(n) are completely multiplicative; e.g. the non-principal character (mod 4) defined in the introduction, or the principal character (mod n) defined by
ω(n), defined above as the number of distinct primes dividing n, is additive
Ω(n), defined above as the number of prime factors of n counted with multiplicities, is completely additive.
For a fixed prime p, νp(n), defined above as the exponent of the largest power of p dividing n, is completely additive.
Unlike the other functions listed in this article, these are defined for non-negative real (not just integer) arguments. They are used in the statement and proof of the prime number theorem.
π(x), the prime counting function, is the number of primes not exceeding x.
A related function counts prime powers with weight 1 for primes, 1/2 for their squares, 1/3 for cubes, ...
θ(x) and ψ(x), the Chebyshev functions are defined as sums of the natural logarithms of the primes not exceeding x:
Λ(n), the von Mangoldt function, is 0 unless the argument is a prime power, in which case it is the natural log of the prime:
p(n), the partition function, is the number of ways of representing n as a sum of positive integers, where two representations with the same summands in a different order are not counted as being different:
λ(n), the Carmichael function, is the smallest positive number such that for all a coprime to n. Equivalently, it is the least common multiple of the orders of the elements of the multiplicative group of integers modulo n.
For powers of odd primes and for 2 and 4, λ(n) is equal to the Euler totient function of n; for powers of 2 greater than 4 it is equal to one half of the Euler totient function of n:
and for general n it is the least common multiple of λ of each of the prime power factors of n:
h(n), the class number function, is the order of the ideal class group of an algebraic extension of the rationals with discriminant n. The notation is ambiguous, as there are in general many extensions with the same discriminant. See quadratic field and cyclotomic field for classical examples.
rk(n) is the number of ways n can be represented as the sum of k squares, where representations that differ only in the order of the summands or in the signs of the square roots are counted as different.
Given an arithmetic function a(n), its summation function A(x) is defined by
A can be regarded as a function of a real variable. Given a positive integer m, A is constant along open intervals m < x < m + 1, and has a jump discontinuity at each integer for which a(m) ≠ 0.
Since such functions are often represented by series and integrals, to achieve pointwise convergence it is usual to define the value at the discontinuities as the average of the values to the left and right:
Individual values of arithmetic functions may fluctuate wildly - as in most of the above examples. Summation functions "smooth out" these fluctuations. In some cases it may be possible to find asymptotic behaviour for the summation function for large x.
A classical example of this phenomenon[4] is given by d(n), the number of divisors of n:
Given an arithmetic function a(n), let Fa(s), for complex s, be the function defined by the corresponding Dirichlet series (where it converges):[5]
Fa(s) is called a generating function of a(n). The simplest such series, corresponding to the constant function a(n) = 1 for all n, is ς(s) the Riemann zeta function.
The generating function of the Möbius function is the inverse of the zeta function:
Consider two arithmetic functions a and b and their respective generating functions Fa(s) and Fb(s). The product Fa(s)Fb(s) can be computed as follows:
It is a straightforward exercise to show that if c(n) is defined by
then
This function c is called the Dirichlet convolution of a and b, and is denoted by .
A particularly important case is convolution with the constant function a(n) = 1 for all n, corresponding to multiplying the generating function by the zeta function:
Multiplying by the inverse of the zeta function gives the Möbius inversion formula:
If f is multiplicative, then so is g. If f is completely multiplicative, then g is multiplicative, but may or may not be completely multiplicative. The article multiplicative function has a short proof.
There are a great many formulas connecting arithmetical functions with each other and with the other functions of analysis - in fact, a large part of elementary and analytic number theory is a detailed study of these relations. See the articles on the individual functions for details.
Here are a few examples:
Define the function σk*(n) as[17]
That is, if n is odd, σk*(n) is the sum of the kth powers of the divisors of n, i.e. σk(n), and if n is even it is the sum of the kth powers of the even divisors of n minus the sum of the kth powers of the odd divisors of n.
Adopt the convention that Ramanujan's τ(x) = 0 if x is not an integer.
Here "convolution" does not mean "Dirichlet convolution" but instead refers to the formula for the coefficients of the product of two power series:
The sequence is called the convolution or the Cauchy product of the seqences an and bn. See Eisenstein series for a discussion of the series and functional identities involved in these formulas.
Since σk(n) (for natural number k) and τ(n) are integers, the above formulas can be used to prove congruences[26] for the functions. See Tau-function for some examples.
Extend the domain of the partition function by setting p(0) = 1.
Let be the nth harmonic number. Then